package com.example.cmtwo.service;

import com.example.cmtwo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OwnMesAmendService
{
    @Autowired
    private UserMapper userMapper;  //在service层调用mapper层接口

    public boolean updateOwnMes(Integer Id, String Son, String Phone, String Sex, String QQ , String Intro)
    {
        try {
            userMapper.updateOwnMes(Id, Son, Phone, Sex, QQ , Intro);
        }catch (Exception e)
        {
            System.out.println(e);
            return false;
        }

        return true;
    }

    public boolean updataName(Integer Id, String Name)
    {
        try {
//            userMapper.updateUname(Id, Name);
            userMapper.updateOwnMesName(Id, Name);
        }catch (Exception e)
        {
            System.out.println(e);
            return false;
        }

        return true;
    }
}
